package com.code2roc.jarmanage.util;

public class StringUtil {
    public static final String EMPTY = "";

    public static boolean isEmpty(String str) {
        return str == null || "".equals(str) || "null".equals(str);
    }

    public static String trim(String str) {
        str = str.replaceAll("\\s+", "");
        StringBuilder sb = new StringBuilder();
        for (char c : str.toCharArray()) {
            if (!Character.isWhitespace(c)) {
                sb.append(c);
            }
        }
        return sb.toString();
    }
}
